home *** CD-ROM | disk | FTP | other *** search
/ Nightshift Sound & Vision / Nightshift - Sound & Vision.iso / programs / anim / buildmpeg / buildmpeg.readme < prev    next >
Text File  |  1994-11-16  |  8KB  |  196 lines

  1. Short:    make MPEGs with ImageFX
  2. Type:     gfx/conv
  3. Author:   mlelstv@serpens.rhein.de
  4. Uploader: mlelstv@serpens.rhein.de
  5.  
  6. Hello,
  7.  
  8. this is my first try to create MPEGs comfortably with ImageFX.
  9. I am using a modified PVRG MPEG codec, the program can now read
  10. input from pipes and can communicate with an AREXX function host
  11. to provide input data.
  12.  
  13. The BuildMPEG.ifx script works as follows:
  14.  
  15. Here for some legal stuff:
  16.  *  Copyright Michael van Elst 1994
  17.  *
  18.  *  This program is freely distributable, but copyrighted by me. This means
  19.  *  that you can copy it freely as long as you don't ask for any more money
  20.  *  than a nominal fee for copying. This program may be put on PD disks,
  21.  *  especially on Fred Fish's AmigaLibDisks.
  22.  *  This program cannot be used for commercial purposes without permission
  23.  *  from the author. The author can not be made responsible for any damage
  24.  *  which is caused by using this program.
  25.  *  
  26.  *  This notice applies to the AREXX script, my changes to the MPEG codec
  27.  *  done by the Portable Video Research Group at Stanford and the resulting
  28.  *  executable contained in the BuildMPEG archive.
  29.  
  30. - query parameters from user
  31.  
  32.   - 'input pattern' denotes the filenames of the input frames
  33.     you can use any picture file format that ImageFX is able to
  34.     load but no ANIM files yet. The pattern is of the form
  35.     prefix%suffix where the the % gets replaced by the frame
  36.     number starting with the 'From' value up to the 'To' value.
  37.     You can use a sequence of % characters to produce a minimal
  38.     number of digits. Say micky.%%%.iff would yield micky.001.iff,
  39.     micky.002.iff,... Lightwave would use a pattern like picture%%%.
  40.  
  41.   - 'output filename' is of course the pathname for the generated
  42.     MPEG stream
  43.  
  44.   - Frame Interval is the distance between the intracoded and predicted
  45.     frames
  46.   - Group Interval is the number of frame intervals in a group
  47.     Both values control the number of generated predicted and interpolated
  48.     frames. The default values of 3 and 2 will generate a pattern like:
  49.     I,B,B,P,B,B,I,B,B,P,B,B...
  50.  
  51.   - Frame Rate tells the encoder what nominal play back speed the stream
  52.     is used for. The MPEG committee agreed on a couple of possible speeds
  53.     often found in video. The encoder will use this value for rate control
  54.     and a possible (hardware) decoder would use that value to set the play
  55.     back speed.
  56.  
  57.   - Bitrate (in kbits/s) tells the Encoder the data transfer speed of the
  58.     target device and is used together with the frame rate for rate
  59.     control. 1200 is the value for CD-ROMs (1200kbit/s = 150kbyte/s).
  60.  
  61.   - Targetsize is the approximate size of the output file. The encoder will
  62.     try to not exceed that file size. The Targetsize option overrides
  63.     the Bitrate option.
  64.  
  65.   - XING Override. Tell the encoder to produce XING compatible MPEG streams.
  66.     This puts certain limitations on the stream, like 160x120 frame size.
  67.     It will also turn of motion estimation, just I frames are produced.
  68.     If source frames aren't already XING sized they will be _scaled_
  69.     accordingly but aspect ratio is not necessarily preserved.
  70.  
  71.   - Query Advanced Options. If checked you'll get another requester where
  72.     you can set more details of the encoding process.
  73.  
  74. - maybe more parameters for 'Advanced Options'
  75.  
  76.   - DC Intraframe mode chooses a special high compression mode where each
  77.     8x8 block just gets its DC value encoded (i.e. average value).
  78.  
  79.   - Use Precise DCT will enable a 'reference DCT' algorithm that works
  80.     with floating point instead of the much faster integer based
  81.     algorithm used normally.
  82.  
  83.   - Motion Vector Telescoping. Extends the motion vector search area
  84.     depending on the temporal distance.
  85.  
  86.   - Dynamic Motion Vector Bounding. Useful (==faster) for frames with
  87.     limited motion vector movement but produces worse results in scenes
  88.     with heavy motion.
  89.  
  90.   - Motion Vector Prediction.
  91.  
  92.   - Search Diameter. Area scanned for moving objects, can be very large
  93.     (say 128). Default is 15.
  94.  
  95.   - Quantization. Initial quantization value (1..31). Rate control will
  96.     adapt this as necessary.
  97.  
  98.   - Control script. The codec can read a script with even more details
  99.     for the encoding process. If the script isn't specified with a
  100.     full pathname it is searched in the directory IMAGEFX:mpegcontrol/
  101.     For more details on the scripting language read the original Codec
  102.     documentation.
  103.  
  104.   - IFX Filter. To adapt input sources to MPEG requirements it is possible
  105.     to insert user specified commands after loading each frame. This string
  106.     gadget accepts a filename or a literal AREXX command. If the filename
  107.     is not absolute (i.e. does not contain a ':') the file is searched in
  108.     the directory IMAGEFX:mpegfilters/. A suffix of ".ifx" is automatically
  109.     appended if necessary.
  110.     If the file cannot be found then the string is executed literally. This
  111.     allows to enter trivial commands directly instead of writing a script.
  112.  
  113. - then the script detrmines the command line parameters for the codec
  114.   and launches it with RUN
  115.  
  116. - the script listens to a an AREXX port where the codec will ask to
  117.   feed it with new frames. The script will tell ImageFX to load these
  118.   frames and to save the Y, U or V parts to a PIPE: where the codec
  119.   will read the data.
  120.  
  121. - the codec tells the script to finish when all frames are processed.
  122.  
  123. The AREXX script currently stores and retrieves all the parameters
  124. into and from the AREXX clip list which means you do not have to
  125. reenter them until the next reboot.
  126.  
  127. Files:
  128.  
  129. mpeg          - the PVRG codec compiled for 68020+ and no FPU
  130. doc.ps        - the original documentation from the PVRG
  131. README        -  ""
  132. SETUP         -  ""
  133. YUVSPLIT.000  - ImageFX saver module compiled for 68000
  134. YUVSPLIT.030  - ImageFX saver module compiled for 68030
  135. BuildMPEG.ifx - AREXX control script
  136. BuildMPEG.readme - this file :)
  137.  
  138. Saver Module:
  139.  
  140. The Saver Module might be useful elsewhere, so here a short description.
  141.  
  142. Choose YUVSPLIT as the output format. ImageFX will ask for a filename.
  143. YUVSPLIT filenames should look like  name.Y, name.U and name.V. If you
  144. give it such a filename it will adjust the suffix for the 3 output
  145. files. If the filename you give it has no such extension it is treated
  146. as a basename where the suffixes are appended.
  147. Because of that filename mangling there is currently no check against
  148. overwriting of existing files.
  149.  
  150. From AREXX you have more fine control.
  151.  
  152. SaveBufferAS YUVSPLIT filename [Y] [U] [V] [NOCCIR601]
  153.  
  154. Without options this acts the same way as from the ImageFX control panel.
  155. If you give it one or more of the Y,U and V flags it will just write
  156. these parts of the image.
  157.  
  158. The NOCCIR601 will turn off scaling of the output to CCIR601 levels.
  159. This might be useful for a JPEG codec which wants a fully saturated
  160. input.
  161.  
  162. The 3 files are _raw_ data, just one pure signed (UV) or unsigned (Y) byte
  163. per pixel and no header. The U and V files are _subsampled_ which means that
  164. every 2x2 block gets a single value. Therefore the U and V files
  165. are just one quarter the size of the Y file.
  166.  
  167. The saver replicates the last row/line as necessary as the MPEG
  168. codec just understands even sized pictures.
  169.  
  170. Installation:
  171.  
  172. create a directory IMAGEFX:mpeg and copy the codec binary (mpeg) into it.
  173. copy the YUVSPLIT and YUVSPLIT.030 saver modules into IMAGEFX:modules/savers
  174. and copy the BuildMPEG.ifx script into IMAGEFX:rexx
  175.  
  176. If you want to use filter scripts I suggest to create a IMAGEFX:mpegfilters
  177. directory and put them there. If you want to play with codec control scripts
  178. you need a directory IMAGEFX:mpegcontrol.
  179.  
  180. For sake of speed I compiled the saver for 68000 and 68030 respectively,
  181. ImageFX will use the correct one for your system.
  182. The codec is compiled for 68020 and mathieee.library
  183.  
  184. Run the script from ImageFX.
  185.  
  186. Previously I said:
  187. "WARNING: Don't try to stop the script. There is a good chance that then
  188. either the script or the codec will wait infinitely on some PIPE access."
  189.  
  190. This version of the script tries to solve most of the problems and in fact
  191. I haven't got any problems anymore from stopping a script.
  192.  
  193. Hope this is enough to get it working :)
  194.  
  195. Michael van Elst
  196.